package Function.Utils;

import java.io.File;
import javax.imageio.ImageIO;

public class FCFileCopyToMaterial {
	private ImageIO imageIO;
	private String[] url = { "./material/png/block/", "./material/png/character/", "./material/png/tank/",
			"./material/png/item/", "./material/png/monster/", "./material/png/animation/" };

	@SuppressWarnings("static-access")
	public String copyPngToMaterialPng(int num, String pngUrl) {
		try {
			File pngFile = new File(pngUrl);
			File targetFile = new File(url[num] + pngFile.getName());
			imageIO.write(imageIO.read(pngFile), "png", targetFile);
			return targetFile.getPath().replaceAll("\\\\", "/");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
}
